/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.File;

/**
 * <p>Project: javaseapp - Dir1
 * <p>Powered by webrx On 2021-08-11 09:04:46
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Dir1 {
    public static void main(String[] args) {
        File file = new File("user");
        if (file.exists()) {
            if (file.isDirectory()) System.out.println("是目录");
            if (file.isFile()) System.out.println("是文件");
        } else {
            //建立目录
            file.mkdir();
            System.out.println(file.getAbsolutePath());
            System.out.println("目录建立成功");
            if (file.isDirectory()) System.out.println("是目录");
            if (file.isFile()) System.out.println("是文件");
            //file.mkdirs();
        }

        System.out.println(file.exists());
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());
        System.out.println(file.isHidden());
    }
}
